package com.ruoyi.kucun.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.kucun.mapper.InventoryAlertMapper;
import com.ruoyi.kucun.domain.InventoryAlert;
import com.ruoyi.kucun.service.IInventoryAlertService;
import com.ruoyi.common.core.text.Convert;

/**
 * 库存预警阈值设置Service业务层处理
 * 
 * @author Rosou
 * @date 2025-06-17
 */
@Service
public class InventoryAlertServiceImpl implements IInventoryAlertService 
{
    @Autowired
    private InventoryAlertMapper inventoryAlertMapper;

    /**
     * 查询库存预警阈值设置
     * 
     * @param alertId 库存预警阈值设置主键
     * @return 库存预警阈值设置
     */
    @Override
    public InventoryAlert selectInventoryAlertByAlertId(Long alertId)
    {
        return inventoryAlertMapper.selectInventoryAlertByAlertId(alertId);
    }

    /**
     * 查询库存预警阈值设置列表
     * 
     * @param inventoryAlert 库存预警阈值设置
     * @return 库存预警阈值设置
     */
    @Override
    public List<InventoryAlert> selectInventoryAlertList(InventoryAlert inventoryAlert)
    {
        return inventoryAlertMapper.selectInventoryAlertList(inventoryAlert);
    }

    /**
     * 新增库存预警阈值设置
     * 
     * @param inventoryAlert 库存预警阈值设置
     * @return 结果
     */
    @Override
    public int insertInventoryAlert(InventoryAlert inventoryAlert)
    {
        return inventoryAlertMapper.insertInventoryAlert(inventoryAlert);
    }

    /**
     * 修改库存预警阈值设置
     * 
     * @param inventoryAlert 库存预警阈值设置
     * @return 结果
     */
    @Override
    public int updateInventoryAlert(InventoryAlert inventoryAlert)
    {
        return inventoryAlertMapper.updateInventoryAlert(inventoryAlert);
    }

    /**
     * 批量删除库存预警阈值设置
     * 
     * @param alertIds 需要删除的库存预警阈值设置主键
     * @return 结果
     */
    @Override
    public int deleteInventoryAlertByAlertIds(String alertIds)
    {
        return inventoryAlertMapper.deleteInventoryAlertByAlertIds(Convert.toStrArray(alertIds));
    }

    /**
     * 删除库存预警阈值设置信息
     * 
     * @param alertId 库存预警阈值设置主键
     * @return 结果
     */
    @Override
    public int deleteInventoryAlertByAlertId(Long alertId)
    {
        return inventoryAlertMapper.deleteInventoryAlertByAlertId(alertId);
    }
}
